import request from '@/utils/request'

// 客户属性列表
export const attrList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/list',
    method: 'get',
    params: data
  })
}

// 新建客户属性
export const attrCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/create',
    method: 'post',
    data
  })
}

// 编辑属性状态
export const updateStatus = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/update/status',
    method: 'post',
    data
  })
}
// 编辑客户来源状态
export const updateCustStatus = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/update/status',
    method: 'post',
    data
  })
}

// 编辑客户属性
export const editAttr = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/update',
    method: 'post',
    data
  })
}

// 删除客户属性
export const delAttr = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/del',
    method: 'post',
    data
  })
}

// 属性高级设置
export const attrAdvanced = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/advanced',
    method: 'post',
    data
  })
}
// 获取属性高级设置数据
export const advancedInfo = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/advanced/info',
    method: 'get',
    params: data
  })
}
// 企业属性
export const getEnterprise = (data: {}) => {
  return request({
    method: 'GET',
    url: '/scrm-api/console/customer/corp-attr/list',
    params: data
  })
}
// 编辑企业属性排序
export const sortEnterprise = (data: {}) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/corp-attr/rank',
    data
  })
}
// 新增企业属性
export const addNewEnterprise = (data: {}) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/corp-attr/create',
    data
  })
}
// 编辑企业属性
export const editEnterprise = (data: {}) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/corp-attr/update',
    data
  })
}
// 删除企业属性
export const delEnterprise = (data: {}) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/corp-attr/del',
    data
  })
}
// 企业属性的开启和关闭
export const startOrDel = (data: any) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/corp-attr/operate',
    data
  })
}
//  客户阶段列表
export const stageList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/list',
    method: 'post',
    data
  })
}
//客户阶段 新建客户阶段
export const stageCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/create',
    method: 'post',
    data
  })
}
//客户阶段 编辑
export const stageEdit = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/edit',
    method: 'post',
    data
  })
}
//客户阶段 删除
export const stageDel = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/del',
    method: 'post',
    data
  })
}
// 客户阶段 排序
export const stageSourceSort = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/sort',
    method: 'post',
    data
  })
}
// 客户阶段高级设置
export const stageAdvanced = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/advanced',
    method: 'post',
    data
  })
}

// 客户设置详情
export const stageAdvancedInfo = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/advanced/info',
    method: 'get',
    params: data
  })
}

// 规则组列表
export const ruleGroupList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/rule-group/list',
    method: 'post',
    data
  })
}

// 新建规则组
export const ruleGroupCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/rule-group/create',
    method: 'post',
    data
  })
}

// 编辑规则组
export const ruleGroupEdit = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/rule-group/edit',
    method: 'post',
    data
  })
}
// 删除规则组
export const ruleGroupDel = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/rule-group/del',
    method: 'post',
    data
  })
}

// 获取规则树
export const ruleGroupTree = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/rule-group/tree',
    method: 'get',
    params: data
  })
}

// 客户阶段 -- 新建提醒
export const remindCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/remind/create',
    method: 'post',
    data
  })
}
// 客户阶段 -- 更新提醒
export const remindUpdate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/remind/update',
    method: 'post',
    data
  })
}
//客户阶段 -- 删除提醒
export const remindDel = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/remind/del',
    method: 'post',
    data
  })
}
//客户阶段 -- 提醒列表
export const remindList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/remind/list',
    method: 'post',
    data
  })
}
// 提醒开关
export const remindSwitch = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/remind/switch',
    method: 'post',
    data
  })
}

// 客户来源 --创建
export const sourceCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/create',
    method: 'post',
    data
  })
}

// 客户来源 --编辑
export const sourceEdit = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/edit',
    method: 'post',
    data
  })
}

// 客户来源 --列表
export const sourceList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/list',
    method: 'post',
    data
  })
}
// 客户来源 --排序

export const sourceSort = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/sort',
    method: 'post',
    data
  })
}

// 无效原因 --创建
export const invalidCreate = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/invalid/create',
    method: 'post',
    data
  })
}

// 无效原因 --编辑
export const invalidEdit = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/invalid/edit',
    method: 'post',
    data
  })
}

// 无效原因 --列表
export const invalidList = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/invalid/list',
    method: 'post',
    data
  })
}
// 无效原因 --排序

export const invalidSort = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/invalid/sort',
    method: 'post',
    data
  })
}
// 无效原因 删除
export const invalidDel = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/invalid/del',
    method: 'post',
    data
  })
}
// 定时任务
export const triggerTask = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/stage/trigger-task',
    method: 'post',
    data
  })
}

//客户属性-排序

export const attrSort = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/attr/sort',
    method: 'POST',
    data
  })
}

//删除自定义来源
export const delSource = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/source/del',
    method: 'POST',
    data
  })
}

//更改客户阶段
export const changeStage = (data: any) => {
  return request({
    url: '/scrm-api/console/customer/change-stage',
    method: 'POST',
    data
  })
}

//获取无效原因列表
export const reasonList = () => {
  return request({
    url: '/scrm-api/console/customer/reason-list',
    method: 'GET'
  })
}